package com.sinosoft.builder.model;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Java语言包含的元素
 * 
 * @author 潘巍（Peter Pan）
 * @since 2010-5-14 下午05:07:31
 */
public class JavaLanguageElement {

	private Set<JavaModifier> modifiers = new HashSet<JavaModifier>();
	private List<JavaAnnotation> annotations = new ArrayList<JavaAnnotation>();
	private List<JavaComment> comments = new ArrayList<JavaComment>();
	private String name;

	public JavaLanguageElement(String name) {
		super();
		this.name = name;
	}

	public Set<JavaModifier> getModifiers() {
		return modifiers;
	}

	public List<JavaAnnotation> getAnnotations() {
		return annotations;
	}

	public List<JavaComment> getComments() {
		return comments;
	}

	public String getName() {
		return name;
	}

	public void addModifier(JavaModifier modifier) {
		modifiers.add(modifier);
	}

	public void addAnnotation(JavaAnnotation annotation) {
		annotations.add(annotation);
	}

	public void addAnnotation(Class<?> annotation, String... arguments) {
		annotations.add(new JavaAnnotation(annotation, arguments));
	}

	public void addAnnotation(Class<?> annotation) {
		annotations.add(new JavaAnnotation(annotation));
	}

}